import 'dart:ui';
import 'package:flutter/material.dart';
import '../public.dart';

/// 我的页面
class InviteCodePage extends StatefulWidget {
  InviteCodePage({Key key}) : super(key: key);

  @override
  _InviteCodePageState createState() {
    return _InviteCodePageState();
  }
}

class _InviteCodePageState extends State<InviteCodePage> {
  bool check = false;
  bool _isOnPressed = false;
  ThemeProvider theme;

  @override
  void initState() {
    super.initState();
  }

  String dropvalue = '086';

  @override
  Widget build(BuildContext context) {
    theme = Provider.of<ThemeProvider>(context);
    return Scaffold(
        backgroundColor: theme.primaryColor,
        appBar: AppBar(
          title: Text('请输入邀请码'),
          backgroundColor: theme.primaryColor,
          leadingWidth: 44,
          leading: BackComponent(),
        ),
        body: Padding(
            padding: EdgeInsets.only(left: 16, top: 64, right: 16),
            child:
                Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
              Text(
                '请输入邀请码',
                style: TextStyle(fontSize: 28, color: Colors.white),
              ),
              SizedBox(
                height: 16,
              ),
              Text(
                '现在加入即可免费看漫画并享萌新特权，赚千元现金',
                style: TextStyle(fontSize: 14, color: Colors.white),
              ),
              SizedBox(
                height: 32,
              ),
              Container(
                  alignment: Alignment.center,
                  height: 48,
                  decoration: BoxDecoration(
                      color: ColorUtil.rgba(255, 255, 255, 0.05),
                      borderRadius: BorderRadius.circular(24.0)),
                  child: TextField(
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 16,
                    ),
                    decoration: InputDecoration(
                      focusColor: ColorUtil.rgba(255, 255, 255, 0.7),
                      hintText: '输入x位邀请码',
                      hintStyle:
                          TextStyle(color: ColorUtil.rgba(255, 255, 255, 0.3)),
                      contentPadding: EdgeInsets.only(left: 24, right: 24),
                      errorBorder: UnderlineInputBorder(
                          borderSide: BorderSide(color: Colors.transparent)),
                      focusedBorder: UnderlineInputBorder(
                          borderSide: BorderSide(color: Colors.transparent)),
                    ),
                  )),
              SizedBox(
                height: 40,
              ),
              FlatButton(
                  onPressed: _onPressed,
                  height: 48,
                  minWidth: double.infinity,
                  textColor: ColorUtil.rgba(51, 51, 51, 1),
                  shape: RoundedRectangleBorder(
                      side: BorderSide.none,
                      borderRadius: BorderRadius.all(Radius.circular(24))),
                  color: ColorUtil.rgba(255, 215, 59, 1),
                  disabledColor: ColorUtil.rgba(255, 215, 59, 0.15),
                  child: Text(
                    '注册并登录',
                    style: TextStyle(fontSize: 18),
                  ))
            ])));
  }

  _onPressed() {
    print('获取验证码');
  }

  void dispose() {
    super.dispose();
  }
}
